package c.x.jy.dao.dao;

import c.x.jy.dao.dto.MemberWalletEntityDto;
import c.x.jy.dao.entity.MemberWalletEntity;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 会员钱包表
 * 
 * @author amwhyh
 * @email xxx@xx.com
 * @date 2021-05-25 10:48:03
 */
@Mapper
public interface MemberWalletDao extends BaseMapper<MemberWalletEntity> {
      @Select("select * from t_member_wallet where id=${id}  for update ")
    MemberWalletEntity selectMemberWalletByIdFOrUpdate(Long id);

    @Select("select mca.*,m.nickname as userName from t_member_wallet mca LEFT JOIN t_member m on mca.member_id=m.id  ${ew.customSqlSegment}")
    IPage<MemberWalletEntityDto> queryPageforWeb(IPage<MemberWalletEntity> page,@Param(Constants.WRAPPER)  QueryWrapper<MemberWalletEntity> query);
}

